<?php if(isset($_POST)) unset($_POST)?>
<?php if (isset($success)):?>
<p>Success add task</p>
<?php endif;?>

<div class="body_main">
<form action="/project/<?php echo $project_id?>/add_task/" method="post" accept-charset="utf-8" class="fancy-form">
	<table>
		<tr class="rowA">
			<td>Assign to </td>
			<td>
				<select name="assign_to">
				<?php foreach($users as $user):?>
					<option value="<?php echo $user['id']?>"><?php echo $user['displayname']?></option>
				<?php endforeach;?>
				</select>
			</td>
		</tr>
	</table>
	
  	<table>
		<tr class="rowA">
			<td>Task name </td>
			<td><?php echo form::input('name', '', array('class'=> 'task_name', 'size' => 100))?></td>
		</tr>
	</table>
	
	<table>
		<tr class="rowA">
			<td>Priority </td>
			<td>
				<select name="priority">
				<?php foreach(Helper_MyConst::$PROJECT_PRIORITY_TABLE as $id => $key): ?>
					<option value="<?php echo $id?>"><?php echo $key?></option>
				<?php endforeach;?>
				</select>
			</td>
		</tr>
	</table>
	
	<table>
		<tr class="rowA">
			<td>Expired: </td>
			<td><?php echo form::input('deadline', '', array('id'=> 'deadline'))?></td>
		</tr>
	</table>
	<table>
		<tr class="rowA">
			<td>Description: </td>
			<td><?php echo form::textarea('description','',array('rows' => 2))?></td>
			<td><?php echo form::button('done', 'Done adding task', array('id' => 'done_add_task'))?>
				<?php echo form::submit('add', 'Add')?>
			</td>
		</tr>
	</table>
	
</form>
</div>
<script type="text/javascript">
	$(document).ready(function(){
		$('input#deadline	').datepicker({
			showOn: "button",
			changeMonth : true,
			dateFormat: 'yy-mm-dd',
			timeFormat: 'hh-mm-ss'
		});
	});
</script>